@isTest(SeeAllData=true)
private class AccUpdateDeptNameHandlerTest {
    static testMethod void testMethod1() {
        Account acc = TestUtils.createAccount();
    	acc.Name = '客户A';
        insert acc;

        Department__c dept = [SELECT d.Id, d.Name FROM Department__c d WHERE d.TerminalCustomer__c = :acc.Id];
        System.assertEquals('客户A检验科', dept.Name);

        SpecialTeam__c st  = new SpecialTeam__c();
        st.Team2Dept__c = dept.Id;
        st.TeamType__c = '生化';
        st.TerminalCustomer__c = acc.Id;
        insert st;

        acc.Name = '客户B';
        update acc;

        dept = [SELECT d.Name FROM Department__c d WHERE d.TerminalCustomer__c = :acc.Id];
        System.assertEquals('客户B检验科', dept.Name);

        st = [select Name from SpecialTeam__c where Id = :st.Id];
        System.assertEquals('客户B检验科生化', st.Name);
    }
}